package com.linko.intelligent.remote.core.timer;

import com.linko.intelligent.remote.core.service.DeviceOnlineTimeCalcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

/**
 * @Author yuan
 * @create 2024/4/27 11:24
 */

@Service
public class DeviceOnlineTimeCalcTimer {

    @Autowired
    DeviceOnlineTimeCalcService deviceOnlineTimeCalcService;

    @Scheduled(cron = "${scheduler.cron.deviceOnlineTimeCalcYesterday}")
    public void exec() {
        System.out.println("刷新昨天的数据");
        deviceOnlineTimeCalcService.refreshYesterday();
    }

    @Scheduled(cron = "${scheduler.cron.deviceOnlineTimeCalcToday}")
    public void exec1() {
        System.out.println("刷新今天的数据");
        deviceOnlineTimeCalcService.refreshToday();
    }
}
